﻿// 1.1.3.11. Write an expression that extracts from a given integer i the value of
// a given bit number b. Example: i=5; b=2 -> value=1.

using System;

class AnyBitOfNumber
{
    static void Main()
    {
        Begin:
        Console.Write("Please enter integer number: ");
        int number = int.Parse(Console.ReadLine());
        Console.Write("Please enter position of the bit you want to check its value: ");
        byte positionBit = byte.Parse(Console.ReadLine());
        Console.WriteLine((number >> (positionBit)) & 1);
        goto Begin;
    }
}